package com.tianhui.consignortwofei.pattern.orderOprate.impl;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import com.tianhui.consignortwofei.constant.ImageType;
import com.tianhui.consignortwofei.constant.KeyValue;
import com.tianhui.consignortwofei.mvp.model.enty.OrderOperateInfo;
import com.tianhui.consignortwofei.mvp.ui.activity.editPicture.EditDeliverBillPictureActivity;
import com.tianhui.consignortwofei.mvp.ui.activity.editPicture.EditDeliverVehiclePictureActivity;
import com.tianhui.consignortwofei.mvp.ui.activity.editPicture.EditLoadingBillPictureActivity;
import com.tianhui.consignortwofei.mvp.ui.activity.editPicture.EditLoadingVehiclePictureActivity;
import com.tianhui.consignortwofei.pattern.orderOprate.IOrderOperate;

/**
 * @author fgs
 * @date 2020/9/1
 * @description 编辑图片
 **/
public class EditPictureOperate implements IOrderOperate {

    @Override
    public void orderOperate(Context context, OrderOperateInfo operateInfo) {

        if (operateInfo != null && operateInfo.orderInfo != null) {
            Bundle bundle = new Bundle();
            bundle.putString(KeyValue.KEY_DISPATCH_NO, operateInfo.orderInfo.dispatchno);
            Intent intent = null;
            switch (operateInfo.type) {
                case ImageType.TYPE_LOADING_BILL:
                    intent = new Intent(context, EditLoadingBillPictureActivity.class);
                    break;
                case ImageType.TYPE_LOADING_VEHICLE:
                    intent = new Intent(context, EditLoadingVehiclePictureActivity.class);
                    break;
                case ImageType.TYPE_DELIVER_BILL:
                    intent = new Intent(context, EditDeliverBillPictureActivity.class);
                    break;
                case ImageType.TYPE_DELIVER_VEHICLE:
                    intent = new Intent(context, EditDeliverVehiclePictureActivity.class);
                    break;
            }

            if (intent != null) {
                intent.putExtras(bundle);
            }
            context.startActivity(intent);

        }


    }
}
